package com.econ.powercloud.ems.service.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.econ.powercloud.ems.dal.entity.EmsGridProcessNode;
import com.econ.powercloud.ems.dal.mapper.EmsGridProcessNodeMapper;
import org.springframework.stereotype.Repository;

/**
 * EmsGridProcessNodeDAO
 * @author jwc
 * @since 2022/08/26
 */
@Repository
public class EmsGridProcessNodeDAO extends ServiceImpl<EmsGridProcessNodeMapper, EmsGridProcessNode> {

    public EmsGridProcessNode selectByProcessGroupIdAndOrderNum(Long processGroupId, Integer orderNum) {
        LambdaQueryWrapper<EmsGridProcessNode> wrapper = Wrappers.<EmsGridProcessNode>lambdaQuery()
                .eq(EmsGridProcessNode::getProcessGroupId, processGroupId)
                .eq(EmsGridProcessNode::getOrderNum, orderNum);
        return this.baseMapper.selectOne(wrapper);
    }
}
